using MediatR;
using Zhaoxi.Zhihu.Core.QuestionAggregate.Events;
using Zhaoxi.Zhihu.HotService.Data;

namespace Zhaoxi.Zhihu.HotService.Handlers;


public class AnswerCreatedEventHandler(QuestionStatManager questionStatManager):INotificationHandler<AnswerCreatedEvent>

{
    public Task Handle(AnswerCreatedEvent notification, CancellationToken cancellationToken)
    {
        questionStatManager. AddAnswerCount(notification.QuestionId);
        return Task.CompletedTask;
    }
}